<template>
  <view>
    <view class="qrcode">
      <canvas  canvas-id="qrcode"></canvas>
    </view>
  </view>
</template>

<script>
import QRCode from "@/util/weapp-qrcode.js";
export default {
  onLoad() {
    var qrcode = new QRCode("qrcode", {
      text: "http://www.baidu.com",
      width: 100,
      height: 100,
      colorDark: "#000000",
      colorLight: "#ffffff",
      correctLevel: QRCode.CorrectLevel.H
    });
  }
};
</script>

<style scoped>
/* #qrcode{
    margin-top: 100px;
    width: 400px;
    height: 400px;
    background: red;
} */
.qrcode {
  margin-top: 50px;
  width: 300px;
  height: 300px;
  margin-left: 50px;
}
</style>